
function ajaxLog(form, action) {
	var params = "login="+form.login.value+"&password="+form.password.value;
	ajaxIt(form, action, params);
}


function ajaxDisconnect(button) {
	ajaxIt(button, "disconnect", "");
	document.getElementById("floatingForm").style.display="none";
}

function ajaxRegister(form, action) {
	var accept;
	for (var i=0; i<form.getElementsByTagName("input").length; i++) {
		var element = form.getElementsByTagName("input")[i];
		if (element.value == "acceptMail") accept = element.checked;
	}
	var params = "login=" + form.login.value + "&password=" + form.password.value + "&acceptMail=" + accept + "&mailAdresse=" + form.mailAdresse.value;
	ajaxIt(form, action, params);

}

function ajaxCheckPseudo(form, action) {
	var params = "login="+form.login.value;
	ajaxIt(form.login, action, params);
}

function ajaxCheckPassword(form, action) {
	var params = "password="+form.password.value;
	ajaxIt(form.password, action, params);
}

function ajaxCheckMail(form, action) {
	var params = "mailAdresse="+form.mailAdresse.value;
	ajaxIt(form.mailAdresse, action, params);
}

function cancelForm(formId) {
	
	var i;
	for (i=0; i<document.getElementById(formId).elements.length; i++) {
		var element = document.getElementById(formId).elements[i];
		if (element.type != "button")
			document.getElementById(formId).elements[i].value="";
		else 
			document.getElementById(formId).elements[i].disabled=false;
	}
	document.getElementById("floatingForm").style.display="none";
	document.body.style.backgroundImage = "url('/Photostock/images/site/"+docStyle+"/fond.png')";
}

function showRegister() {
	document.getElementById("floatingForm").style.display="block";
	document.body.style.backgroundImage = "url('/Photostock/images/site/"+docStyle+"/fondSaisie.png')";
	//document.getElementById("album").style.zIndex = -1;
	document.getElementById("contentMainForm").mailAdresse.disabled=true;
}

function acceptMail(box) {
	if (box.checked) 
		document.getElementById("contentMainForm").mailAdresse.disabled=false;
	else 
		document.getElementById("contentMainForm").mailAdresse.disabled=true;
}
